import { Row, Col } from "antd"
import { Checkbox } from "antd"
import { useEffect, useState } from "react"
import { LocalSetting, LocalSettingType } from "@/popup/services/localSetting"

export const CustomSetting = () => {
    const [initSetting, setInitSetting] = useState<LocalSettingType>({} as LocalSettingType)
    const [displayFavour, setDisplayFavour] = useState(0)
    useEffect(() => {
        LocalSetting?.getCustomLocalSetting()?.then((res: LocalSettingType) => {
            setInitSetting(res)
            setDisplayFavour(res?.displayFavour)
        })
    }, [])
    const reset = () => {
        setDisplayFavour(initSetting?.displayFavour)
    }

    return <div style={{ width: '100%' }}>
        <Row>
            <Col span={8}>
                <Checkbox onChange={() => setDisplayFavour(displayFavour === 0 ? 1 : 0)} defaultChecked={displayFavour ? true : false}>默认筛选关注成员</Checkbox>
            </Col>
            <Col span={8}><Checkbox>默认接收新翻牌信息</Checkbox></Col>
            <Col span={8}><Checkbox>默认推送关注成员翻牌</Checkbox></Col>
        </Row>
    </div>
}